local O uid line_code fact_cod
foreach o of local O {
	distinct `o'
	gen zdist_`o' = `r(ndistinct)'
}

eststo O_TB2_C1: estpost tabstat zdist_*, statistics(mean) columns(statistics)
esttab O_TB2_C1 using "${tables}\TableB2.tex", cells("Mean(fmt(a2))")  nomtitles label nonumbers noobs unstack replace posthead(" ") nodep collabels(none) prehead(" ") postfoot(" ")

drop zdist_*